<%@ page language="java" contentType="text/html;charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<script type="text/javascript">
function validate(){
	if(form.article_name.value==""){
		alert("文章名不能为空");	
		return false;
	}
}
</script>
<%
 	if(session.getAttribute("user")==null||(Integer)session.getAttribute("logged")!=1){
		System.out.println(1);
		out.println("<script>alert('请先登录！');window.location='login.html';</script>");
	}
	if(session.getAttribute("articleName")==null||session.getAttribute("articleContent")==null){
		System.out.println(12);
		out.println("window.location='index.jsp';</script>");
	}
	String articleName=(String)session.getAttribute("articleName");
	String articleContent=(String)session.getAttribute("articleContent");
%>
<title>编辑文章</title>
</head>
<body>
<form action="save" id="form" onsubmit="return validate()" method="post">
<input type="submit" value="保存"><br>
文章名：<input type="text" name="article_name" value="<%=articleName%>">
</form>
<br>
<textarea rows="40" cols="200" name="article_content" form="form"><%=articleContent %></textarea>
</body>
</html>